/* Copyright (c) 2010 OFXKit
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import <Foundation/Foundation.h>

#import "OFXObject.h"
#import "OFXInvestmentAccount.h"
#import "OFXCurrency.h"
#import "OFXSecurity.h"

@interface OFXInvestmentPosition : OFXObject {
  OFXSecurity* security;
  NSString* heldInAccount;
  NSString* positionType;
  NSNumber* units;
  NSNumber* unitPrice;
  NSNumber* marketValue;
  NSDate* priceAndValueValidAsOf;
  OFXCurrency* currency;
  NSString* memo;
  NSString* investment401kSource;
}

/**
 * @property security
 * @brief Underlying security of position.
 */
@property(retain) OFXSecurity* security;

/**
 * @property heldInAccount
 * @brief Sub-account type: CASH, MARGIN, SHORT, OTHER
 */
@property(retain) NSString* heldInAccount;

/**
 * @property positionType
 * @brief Position type
 *
 * One of:
 * - SHORT = Writer for options, Short for all others. 
 * - LONG = Holder for options, Long for all others.
 */
@property(retain) NSString* positionType;

/**
 * @property units
 * @brief Quantity of stocks, MFs, and other securities, expressed as number of 
 * shares held.
 *
 * For bonds = face value, for options = number of contracts.
 */
@property(retain) NSNumber* units;

/**
 * @property unitPrice
 * @brief Price per unit.
 */
@property(retain) NSNumber* unitPrice;

/**
 * @property marketValue
 * @brief Market value of position.
 */
@property(retain) NSNumber* marketValue;

/**
 * @property priceAndValueValidAsOf
 * @brief Unit price and market value valid as of date.
 */
@property(retain) NSDate* priceAndValueValidAsOf;

/**
 * @property currency
 * @brief Currency unitPrice and marketValue are expressed in.
 */
@property(retain) OFXCurrency* currency;

/**
 * @property memo
 * @brief Comments relating to position
 */
@property(retain) NSString* memo;

/**
 * @property investment401kSource
 * @brief For 401(k) accounts, source of money used for this security. 
 *
 * Must be one of the following:
 * - PRETAX 
 * - AFTERTAX 
 * - MATCH 
 * - PROFITSHARING 
 * - ROLLOVER 
 * - OTHERVEST 
 * - OTHERNONVEST
 * 
 * Default if not present is OTHERNONVEST. The following cash source types are
 * subject to vesting: MATCH, PROFITSHARING, and OTHERVEST.
 */
@property(retain) NSString* investment401kSource;

@end
